package com.jason.library;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author ChenBaoyang
 * @description: TestMain
 * @date 2021/8/30 11:26
 */
public class TestMain {

    public static void main(String[] args) {
        String str = "<img onclick=\"rawImg(292049182,this);\"   mime=\"image/png\" src=\"https://p.img4399.com/292049182/5\" data-src=\"https://p.img4399.com/292049182/7\">\n" +
                "</p>";
        //String pattern = "image/(gif|jpeg|png|jpg|bmp)";
        String pattern = "image/[\\w]{3,4}";
        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(str);
        System.out.println(m.find());
        //System.out.println(m.group(0));
    }
}
